﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace Kimd.Common
{
    public class StringHelper : SingletonProvider<StringHelper>
    {
        public bool HasIllegalChar(string ss)
        {
            Regex reg = new Regex(@"^[A-Za-z0-9_-]+$");
            return !reg.IsMatch(ss);
        }

        public bool IsFirstCharNumber(string ss)
        {
            Regex reg = new Regex(@"^[0-9_-]");
            return reg.IsMatch(ss);
        }

        public bool HasCharacter(string ss)
        {
            return Regex.Matches(ss, "[a-zA-Z]").Count > 0;
        }
    }
}
